<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Star(uname, age, song) {
        this.uname = uname
        this.age = age
        this.song = song
      }

      //将公共方法挂载到原型对象上
      Star.prototype.sing = function () {
        console.log(`我会唱${this.song}`)
      }

      Star.dance = function () {
        console.log('我会跳舞')
      }

      const zjl = new Star('周杰伦', 40, '一路向北')

      //   zjl.sing()

      //   //   zjl.dance()
      //   Star.dance()

      //   new Function()

      //   console.log(Star.__proto__ === Function.prototype)

      //   console.log(Star.__proto__.__proto__ === Object.prototype)

      //   console.dir(Object)

      const arr = [1, 2, 3, 4]

      console.log(arr.toString())

      const obj = {
        uname: 'ikun',
      }

      console.log(obj.toString())
    </script>
  </body>
</html>
